<route>
    {
        meta: {
            layout: 'index',
            title:'文章预览'
        }
    }  
  </route>
<template>
    <view>
        <div id="preview"></div>
    </view>
</template>
<script setup>
import Vditor from 'vditor'
import 'vditor/dist/index.css'
import useAppStore from '@/store/modules/app'
const appStore = useAppStore();
import { queryOne } from '@/module/cms/api/article';
const route = useRoute();
queryOne(route.params.id).then(res => {
    let markdown = res.content; 
    Vditor.preview(document.getElementById('preview'),
        markdown, {
        speech: {
            enable: true,
        },
        anchor: 1,
        after() {
           
        }
    })
})
</script>